6a913339259fe81b74d5a83b10b468d50547cfd0,ph-ubl20/src/main/java/com/helger/ubl20/UBL20Marshaller.java,UBL20Marshaller,_createMarshaller,#Class#String#ValidationEventHandler#,257

Before Change


  {
    // Since creating the JAXB context is quite cost intensive this is done
    // only once!
    final JAXBContext aJAXBContext = JAXBContextCache.getInstance ().getFromCache (aClass);

    // create an Unmarshaller
    final Marshaller aMarshaller = aJAXBContext.createMarshaller ();
    aMarshaller.setEventHandler (aCustomEventHandler != null ? aCustomEventHandler
                                                             : new LoggingValidationEventHandler (aMarshaller.getEventHandler ()));

    // Validating!
    aMarshaller.setSchema (UBL20DocumentTypes.getSchemaOfNamespace (sNamespaceURI));
    try
    {
      JAXBMarshallerHelper.setSunNamespacePrefixMapper (aMarshaller, UBL20NamespaceContext.getInstance ());

After Change


                                                   @Nullable final ValidationEventHandler aCustomEventHandler) throws JAXBException
  {
    // Validating!
    final Schema aSchema = UBL20DocumentTypes.getSchemaOfNamespace (sNamespaceURI);
    if (aSchema == null)
      throw new IllegalArgumentException ("Don't know how to write UBL object of class '" + sNamespaceURI + "'");